package com.ys.service.amazonorder.impl;

import com.ys.mapper.amazonorder.AmazonorderMapper;
import com.ys.service.amazonorder.TcoDayProductJPSumService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("tcoDayProductJPSumService")
public class TcoDayProductJPSumServiceImpl implements TcoDayProductJPSumService {
    private static final Logger logger = LoggerFactory.getLogger(TcoDayProductJPSumServiceImpl.class);

    @Autowired
    private AmazonorderMapper diySqlMapper;
    @Override
    public void addBatch(String day) {
        if (day == null || day.length() != 10) {
            return;
        }

        // 删除数据
        diySqlMapper.deleteBatchTcoDayProductJPSum(day);

        // 添加数据
        int i = diySqlMapper.insertBatchTcoDayProductJPSum(day);
        logger.info("时间---" + day + "，添加数量---" + i);
    }
}
